package me.felix.system.facade.controller.core;

import io.swagger.annotations.ApiOperation;
import me.felix.system.biz.dto.UserDTO;
import me.felix.system.biz.service.UserService;
import me.felix.system.integration.po.UserPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author felix
 * @date 2022/1/8/0008
 */


@RestController
@RequestMapping("/api/user")
public class UserController {

    @Autowired
    UserService userService;

    @GetMapping("/list/{id}")
    @ApiOperation("查询商品列表")
    public List<UserDTO> getUserById(@PathVariable("id") @NotNull(message = "id为空") String id) {
        return userService.getUserById(id);
    }

    @GetMapping("/list/a/{ids}")
    @ApiOperation("查询商品列表")
    public String getUserByIds(@PathVariable("ids") @NotNull(message = "id为空") String id) {
        return "new ResponseEntity(userService.getUserById(id),HttpStatus.OK)";
    }

}
